java for loop with scanners